import { Redirect } from 'umi'
import useAuth from '../hooks/useAuth'
export default (props:any) => {
  const  data  = useAuth();
  if (data.length !== 0) {
    return <div>{ props.children }</div>;
  } else {
    return <Redirect to="/login" />;
  }
}